package com.tianqu.tms.core.webservice.weichat.api.mq;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.webservice.weichat.api.StockMessageServer;
import com.tianqu.tms.core.webservice.weichat.api.TransferMessageServer;

/**
 * Created by wu-xz on 2017/2/9.
 */
public class MqListener implements ServletContextListener {
	protected Logger LOGGER = Logger.getLogger(getClass());
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        try {
        	StockMessageServer.getInstance().start();
        	TransferMessageServer.getInstance().start();
        } catch (Exception e) {
        	LOGGER.error(e);
        }
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
